using BCW;
using I2.Loc;
using UnityEngine;

public class LeagueElement : MonoBehaviour
{
	public UIBasicSprite iconCup;

	public UILabel nameCup;

	public UISprite backGround;

	public UISprite curLeagueBackground;

	public CupsInfo cupsInfo;

	public string nameLeague;

	public GameObject neededCupsInfo;

	public UILabel needeCupsLabel;

	public void Init(CupsInfo cupsInfo)
	{
		iconCup = iconCup.ReplaceForCurrentPlatform();
		this.cupsInfo = cupsInfo;
		nameLeague = cupsInfo.league.ToString();
		nameCup.text = ScriptLocalization.Get("Game_Common/" + nameLeague);
		iconCup.LoadTextureAndAlphaMask("LigasIcons/", nameLeague);
		if (cupsInfo.cupsCount > 0)
		{
			needeCupsLabel.text = cupsInfo.cupsCount.ToString();
			neededCupsInfo.SetActive(true);
		}
		else
		{
			needeCupsLabel.text = string.Empty;
			neededCupsInfo.SetActive(false);
		}
	}

	public void ShowIcon(bool val)
	{
		iconCup.gameObject.SetActive(val);
		nameCup.gameObject.SetActive(val);
		backGround.gameObject.SetActive(val);
		curLeagueBackground.gameObject.SetActive(false);
	}
}
